package adt;

import kernel.CPU;
import kernel.CPU.Request;
/**
 * 
 * @author Aaron Fung
 * 		   Chris Ren
 * @version 1.0
 */
public class ProducerProcess extends CPUprocess {

	/**
	 * Construct that takes an int as it's process ID.
	 * @param the_pid the process id.
	 */
	public ProducerProcess(final int the_pid) {
		super(the_pid);
	}


	@Override
	public String toString() {
		return "PID: " + getPid() + "     Type: Producer Process\n";
	}

	/**
	 * return a SYS_write_REQUEST.
	 */
	@Override
	public Request getRequest() {
		return CPU.Request.SYS_WR_REQUEST;
	}


	/**
	 * Output to the screen. 
	 * The process stop for 10 ms.
	 */
	@Override
	public void proceessoutput() {
		try {
			Thread.sleep(10);
		} catch (InterruptedException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
//		System.out.println(this.toString() + " is runing... Step: " + getPCB().getStep() + 
//				" Generates Interrupt at: " + getPCB().getEvent());
		
	}



}
